<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>BaseNCodec (Commons Codec 1.8 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="BaseNCodec (Commons Codec 1.8 API)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/BaseNCodec.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/commons/codec/binary/Base64OutputStream.html" title="class in org.apache.commons.codec.binary"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/commons/codec/binary/BaseNCodecInputStream.html" title="class in org.apache.commons.codec.binary"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/commons/codec/binary/BaseNCodec.html" target="_top">Frames</a></li>
<li><a href="BaseNCodec.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.commons.codec.binary</div>
<h2 title="Class BaseNCodec" class="title">Class BaseNCodec</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.commons.codec.binary.BaseNCodec</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../../../../../org/apache/commons/codec/BinaryDecoder.html" title="interface in org.apache.commons.codec">BinaryDecoder</a>, <a href="../../../../../org/apache/commons/codec/BinaryEncoder.html" title="interface in org.apache.commons.codec">BinaryEncoder</a>, <a href="../../../../../org/apache/commons/codec/Decoder.html" title="interface in org.apache.commons.codec">Decoder</a>, <a href="../../../../../org/apache/commons/codec/Encoder.html" title="interface in org.apache.commons.codec">Encoder</a></dd>
</dl>
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../../../../org/apache/commons/codec/binary/Base32.html" title="class in org.apache.commons.codec.binary">Base32</a>, <a href="../../../../../org/apache/commons/codec/binary/Base64.html" title="class in org.apache.commons.codec.binary">Base64</a></dd>
</dl>
<hr>
<br>
<pre>public abstract class <span class="strong">BaseNCodec</span>
extends <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>
implements <a href="../../../../../org/apache/commons/codec/BinaryEncoder.html" title="interface in org.apache.commons.codec">BinaryEncoder</a>, <a href="../../../../../org/apache/commons/codec/BinaryDecoder.html" title="interface in org.apache.commons.codec">BinaryDecoder</a></pre>
<div class="block">Abstract superclass for Base-N encoders and decoders.

 <p>
 This class is thread-safe.
 </p></div>
<dl><dt><span class="strong">Version:</span></dt>
  <dd>$Id: BaseNCodec.java 1465182 2013-04-06 04:03:12Z ggregory $</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!--   -->
</a>
<h3>Field Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/BaseNCodec.html#lineLength">lineLength</a></strong></code>
<div class="block">Chunksize for encoding.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/BaseNCodec.html#MASK_8BITS">MASK_8BITS</a></strong></code>
<div class="block">Mask used to extract 8 bits, used in decoding bytes</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/BaseNCodec.html#MIME_CHUNK_SIZE">MIME_CHUNK_SIZE</a></strong></code>
<div class="block">MIME chunk size per RFC 2045 section 6.8.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected byte</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/BaseNCodec.html#PAD">PAD</a></strong></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected static byte</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/BaseNCodec.html#PAD_DEFAULT">PAD_DEFAULT</a></strong></code>
<div class="block">Byte used to pad output.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/BaseNCodec.html#PEM_CHUNK_SIZE">PEM_CHUNK_SIZE</a></strong></code>
<div class="block">PEM chunk size per RFC 1421 section 4.3.2.4.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier</th>
<th class="colLast" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected </code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/BaseNCodec.html#BaseNCodec(int, int, int, int)">BaseNCodec</a></strong>(int&nbsp;unencodedBlockSize,
          int&nbsp;encodedBlockSize,
          int&nbsp;lineLength,
          int&nbsp;chunkSeparatorLength)</code>
<div class="block">Note <code>lineLength</code> is rounded down to the nearest multiple of <a href="../../../../../org/apache/commons/codec/binary/BaseNCodec.html#encodedBlockSize"><code>encodedBlockSize</code></a>
 If <code>chunkSeparatorLength</code> is zero, then chunking is disabled.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/BaseNCodec.html#containsAlphabetOrPad(byte[])">containsAlphabetOrPad</a></strong>(byte[]&nbsp;arrayOctet)</code>
<div class="block">Tests a given byte array to see if it contains any characters within the alphabet or PAD.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>byte[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/BaseNCodec.html#decode(byte[])">decode</a></strong>(byte[]&nbsp;pArray)</code>
<div class="block">Decodes a byte[] containing characters in the Base-N alphabet.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/BaseNCodec.html#decode(java.lang.Object)">decode</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj)</code>
<div class="block">Decodes an Object using the Base-N algorithm.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>byte[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/BaseNCodec.html#decode(java.lang.String)">decode</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;pArray)</code>
<div class="block">Decodes a String containing characters in the Base-N alphabet.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>byte[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/BaseNCodec.html#encode(byte[])">encode</a></strong>(byte[]&nbsp;pArray)</code>
<div class="block">Encodes a byte[] containing binary data, into a byte[] containing characters in the alphabet.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/BaseNCodec.html#encode(java.lang.Object)">encode</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj)</code>
<div class="block">Encodes an Object using the Base-N algorithm.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/BaseNCodec.html#encodeAsString(byte[])">encodeAsString</a></strong>(byte[]&nbsp;pArray)</code>
<div class="block">Encodes a byte[] containing binary data, into a String containing characters in the appropriate alphabet.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/BaseNCodec.html#encodeToString(byte[])">encodeToString</a></strong>(byte[]&nbsp;pArray)</code>
<div class="block">Encodes a byte[] containing binary data, into a String containing characters in the Base-N alphabet.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected byte[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/BaseNCodec.html#ensureBufferSize(int, org.apache.commons.codec.binary.BaseNCodec.Context)">ensureBufferSize</a></strong>(int&nbsp;size,
                org.apache.commons.codec.binary.BaseNCodec.Context&nbsp;context)</code>
<div class="block">Ensure that the buffer has room for <code>size</code> bytes</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/BaseNCodec.html#getDefaultBufferSize()">getDefaultBufferSize</a></strong>()</code>
<div class="block">Get the default buffer size.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/BaseNCodec.html#getEncodedLength(byte[])">getEncodedLength</a></strong>(byte[]&nbsp;pArray)</code>
<div class="block">Calculates the amount of space needed to encode the supplied array.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected abstract boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/BaseNCodec.html#isInAlphabet(byte)">isInAlphabet</a></strong>(byte&nbsp;value)</code>
<div class="block">Returns whether or not the <code>octet</code> is in the current alphabet.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/BaseNCodec.html#isInAlphabet(byte[], boolean)">isInAlphabet</a></strong>(byte[]&nbsp;arrayOctet,
            boolean&nbsp;allowWSPad)</code>
<div class="block">Tests a given byte array to see if it contains only valid characters within the alphabet.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/BaseNCodec.html#isInAlphabet(java.lang.String)">isInAlphabet</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;basen)</code>
<div class="block">Tests a given String to see if it contains only valid characters within the alphabet.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected static boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/BaseNCodec.html#isWhiteSpace(byte)">isWhiteSpace</a></strong>(byte&nbsp;byteToCheck)</code>
<div class="block">Checks if a byte value is whitespace or not.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!--   -->
</a>
<h3>Field Detail</h3>
<a name="MIME_CHUNK_SIZE">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>MIME_CHUNK_SIZE</h4>
<pre>public static final&nbsp;int MIME_CHUNK_SIZE</pre>
<div class="block">MIME chunk size per RFC 2045 section 6.8.

 <p>
 The 76 character limit does not count the trailing CRLF, but counts all other characters, including any
 equal signs.
 </p></div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045 section 6.8</a>, 
<a href="../../../../../constant-values.html#org.apache.commons.codec.binary.BaseNCodec.MIME_CHUNK_SIZE">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="PEM_CHUNK_SIZE">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>PEM_CHUNK_SIZE</h4>
<pre>public static final&nbsp;int PEM_CHUNK_SIZE</pre>
<div class="block">PEM chunk size per RFC 1421 section 4.3.2.4.

 <p>
 The 64 character limit does not count the trailing CRLF, but counts all other characters, including any
 equal signs.
 </p></div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="http://tools.ietf.org/html/rfc1421">RFC 1421 section 4.3.2.4</a>, 
<a href="../../../../../constant-values.html#org.apache.commons.codec.binary.BaseNCodec.PEM_CHUNK_SIZE">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="MASK_8BITS">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>MASK_8BITS</h4>
<pre>protected static final&nbsp;int MASK_8BITS</pre>
<div class="block">Mask used to extract 8 bits, used in decoding bytes</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.commons.codec.binary.BaseNCodec.MASK_8BITS">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="PAD_DEFAULT">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>PAD_DEFAULT</h4>
<pre>protected static final&nbsp;byte PAD_DEFAULT</pre>
<div class="block">Byte used to pad output.</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.commons.codec.binary.BaseNCodec.PAD_DEFAULT">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="PAD">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>PAD</h4>
<pre>protected final&nbsp;byte PAD</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.commons.codec.binary.BaseNCodec.PAD">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="lineLength">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>lineLength</h4>
<pre>protected final&nbsp;int lineLength</pre>
<div class="block">Chunksize for encoding. Not used when decoding.
 A value of zero or less implies no chunking of the encoded data.
 Rounded down to nearest multiple of encodedBlockSize.</div>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="BaseNCodec(int, int, int, int)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>BaseNCodec</h4>
<pre>protected&nbsp;BaseNCodec(int&nbsp;unencodedBlockSize,
          int&nbsp;encodedBlockSize,
          int&nbsp;lineLength,
          int&nbsp;chunkSeparatorLength)</pre>
<div class="block">Note <code>lineLength</code> is rounded down to the nearest multiple of <a href="../../../../../org/apache/commons/codec/binary/BaseNCodec.html#encodedBlockSize"><code>encodedBlockSize</code></a>
 If <code>chunkSeparatorLength</code> is zero, then chunking is disabled.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>unencodedBlockSize</code> - the size of an unencoded block (e.g. Base64 = 3)</dd><dd><code>encodedBlockSize</code> - the size of an encoded block (e.g. Base64 = 4)</dd><dd><code>lineLength</code> - if &gt; 0, use chunking with a length <code>lineLength</code></dd><dd><code>chunkSeparatorLength</code> - the chunk separator length, if relevant</dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="getDefaultBufferSize()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDefaultBufferSize</h4>
<pre>protected&nbsp;int&nbsp;getDefaultBufferSize()</pre>
<div class="block">Get the default buffer size. Can be overridden.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd><a href="../../../../../org/apache/commons/codec/binary/BaseNCodec.html#DEFAULT_BUFFER_SIZE"><code>DEFAULT_BUFFER_SIZE</code></a></dd></dl>
</li>
</ul>
<a name="ensureBufferSize(int, org.apache.commons.codec.binary.BaseNCodec.Context)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ensureBufferSize</h4>
<pre>protected&nbsp;byte[]&nbsp;ensureBufferSize(int&nbsp;size,
                      org.apache.commons.codec.binary.BaseNCodec.Context&nbsp;context)</pre>
<div class="block">Ensure that the buffer has room for <code>size</code> bytes</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>size</code> - minimum spare space required</dd><dd><code>context</code> - the context to be used</dd></dl>
</li>
</ul>
<a name="isWhiteSpace(byte)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isWhiteSpace</h4>
<pre>protected static&nbsp;boolean&nbsp;isWhiteSpace(byte&nbsp;byteToCheck)</pre>
<div class="block">Checks if a byte value is whitespace or not.
 Whitespace is taken to mean: space, tab, CR, LF</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>byteToCheck</code> - the byte to check</dd>
<dt><span class="strong">Returns:</span></dt><dd>true if byte is whitespace, false otherwise</dd></dl>
</li>
</ul>
<a name="encode(java.lang.Object)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>encode</h4>
<pre>public&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;encode(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj)
              throws <a href="../../../../../org/apache/commons/codec/EncoderException.html" title="class in org.apache.commons.codec">EncoderException</a></pre>
<div class="block">Encodes an Object using the Base-N algorithm. This method is provided in order to satisfy the requirements of
 the Encoder interface, and will throw an EncoderException if the supplied object is not of type byte[].</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/Encoder.html#encode(java.lang.Object)">encode</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/commons/codec/Encoder.html" title="interface in org.apache.commons.codec">Encoder</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>obj</code> - Object to encode</dd>
<dt><span class="strong">Returns:</span></dt><dd>An object (of type byte[]) containing the Base-N encoded data which corresponds to the byte[] supplied.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/EncoderException.html" title="class in org.apache.commons.codec">EncoderException</a></code> - if the parameter supplied is not of type byte[]</dd></dl>
</li>
</ul>
<a name="encodeToString(byte[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>encodeToString</h4>
<pre>public&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;encodeToString(byte[]&nbsp;pArray)</pre>
<div class="block">Encodes a byte[] containing binary data, into a String containing characters in the Base-N alphabet.
 Uses UTF8 encoding.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>pArray</code> - a byte array containing binary data</dd>
<dt><span class="strong">Returns:</span></dt><dd>A String containing only Base-N character data</dd></dl>
</li>
</ul>
<a name="encodeAsString(byte[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>encodeAsString</h4>
<pre>public&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;encodeAsString(byte[]&nbsp;pArray)</pre>
<div class="block">Encodes a byte[] containing binary data, into a String containing characters in the appropriate alphabet.
 Uses UTF8 encoding.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>pArray</code> - a byte array containing binary data</dd>
<dt><span class="strong">Returns:</span></dt><dd>String containing only character data in the appropriate alphabet.</dd></dl>
</li>
</ul>
<a name="decode(java.lang.Object)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decode</h4>
<pre>public&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;decode(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj)
              throws <a href="../../../../../org/apache/commons/codec/DecoderException.html" title="class in org.apache.commons.codec">DecoderException</a></pre>
<div class="block">Decodes an Object using the Base-N algorithm. This method is provided in order to satisfy the requirements of
 the Decoder interface, and will throw a DecoderException if the supplied object is not of type byte[] or String.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/Decoder.html#decode(java.lang.Object)">decode</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/commons/codec/Decoder.html" title="interface in org.apache.commons.codec">Decoder</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>obj</code> - Object to decode</dd>
<dt><span class="strong">Returns:</span></dt><dd>An object (of type byte[]) containing the binary data which corresponds to the byte[] or String
         supplied.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/DecoderException.html" title="class in org.apache.commons.codec">DecoderException</a></code> - if the parameter supplied is not of type byte[]</dd></dl>
</li>
</ul>
<a name="decode(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decode</h4>
<pre>public&nbsp;byte[]&nbsp;decode(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;pArray)</pre>
<div class="block">Decodes a String containing characters in the Base-N alphabet.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>pArray</code> - A String containing Base-N character data</dd>
<dt><span class="strong">Returns:</span></dt><dd>a byte array containing binary data</dd></dl>
</li>
</ul>
<a name="decode(byte[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decode</h4>
<pre>public&nbsp;byte[]&nbsp;decode(byte[]&nbsp;pArray)</pre>
<div class="block">Decodes a byte[] containing characters in the Base-N alphabet.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/BinaryDecoder.html#decode(byte[])">decode</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/commons/codec/BinaryDecoder.html" title="interface in org.apache.commons.codec">BinaryDecoder</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>pArray</code> - A byte array containing Base-N character data</dd>
<dt><span class="strong">Returns:</span></dt><dd>a byte array containing binary data</dd></dl>
</li>
</ul>
<a name="encode(byte[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>encode</h4>
<pre>public&nbsp;byte[]&nbsp;encode(byte[]&nbsp;pArray)</pre>
<div class="block">Encodes a byte[] containing binary data, into a byte[] containing characters in the alphabet.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/BinaryEncoder.html#encode(byte[])">encode</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/commons/codec/BinaryEncoder.html" title="interface in org.apache.commons.codec">BinaryEncoder</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>pArray</code> - a byte array containing binary data</dd>
<dt><span class="strong">Returns:</span></dt><dd>A byte array containing only the basen alphabetic character data</dd></dl>
</li>
</ul>
<a name="isInAlphabet(byte)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isInAlphabet</h4>
<pre>protected abstract&nbsp;boolean&nbsp;isInAlphabet(byte&nbsp;value)</pre>
<div class="block">Returns whether or not the <code>octet</code> is in the current alphabet.
 Does not allow whitespace or pad.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>value</code> - The value to test</dd>
<dt><span class="strong">Returns:</span></dt><dd><code>true</code> if the value is defined in the current alphabet, <code>false</code> otherwise.</dd></dl>
</li>
</ul>
<a name="isInAlphabet(byte[], boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isInAlphabet</h4>
<pre>public&nbsp;boolean&nbsp;isInAlphabet(byte[]&nbsp;arrayOctet,
                   boolean&nbsp;allowWSPad)</pre>
<div class="block">Tests a given byte array to see if it contains only valid characters within the alphabet.
 The method optionally treats whitespace and pad as valid.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>arrayOctet</code> - byte array to test</dd><dd><code>allowWSPad</code> - if <code>true</code>, then whitespace and PAD are also allowed</dd>
<dt><span class="strong">Returns:</span></dt><dd><code>true</code> if all bytes are valid characters in the alphabet or if the byte array is empty;
         <code>false</code>, otherwise</dd></dl>
</li>
</ul>
<a name="isInAlphabet(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isInAlphabet</h4>
<pre>public&nbsp;boolean&nbsp;isInAlphabet(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;basen)</pre>
<div class="block">Tests a given String to see if it contains only valid characters within the alphabet.
 The method treats whitespace and PAD as valid.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>basen</code> - String to test</dd>
<dt><span class="strong">Returns:</span></dt><dd><code>true</code> if all characters in the String are valid characters in the alphabet or if
         the String is empty; <code>false</code>, otherwise</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/commons/codec/binary/BaseNCodec.html#isInAlphabet(byte[], boolean)"><code>isInAlphabet(byte[], boolean)</code></a></dd></dl>
</li>
</ul>
<a name="containsAlphabetOrPad(byte[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>containsAlphabetOrPad</h4>
<pre>protected&nbsp;boolean&nbsp;containsAlphabetOrPad(byte[]&nbsp;arrayOctet)</pre>
<div class="block">Tests a given byte array to see if it contains any characters within the alphabet or PAD.

 Intended for use in checking line-ending arrays</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>arrayOctet</code> - byte array to test</dd>
<dt><span class="strong">Returns:</span></dt><dd><code>true</code> if any byte is a valid character in the alphabet or PAD; <code>false</code> otherwise</dd></dl>
</li>
</ul>
<a name="getEncodedLength(byte[])">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getEncodedLength</h4>
<pre>public&nbsp;long&nbsp;getEncodedLength(byte[]&nbsp;pArray)</pre>
<div class="block">Calculates the amount of space needed to encode the supplied array.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>pArray</code> - byte[] array which will later be encoded</dd>
<dt><span class="strong">Returns:</span></dt><dd>amount of space needed to encoded the supplied array.
 Returns a long since a max-len array will require > Integer.MAX_VALUE</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/BaseNCodec.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/commons/codec/binary/Base64OutputStream.html" title="class in org.apache.commons.codec.binary"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/commons/codec/binary/BaseNCodecInputStream.html" title="class in org.apache.commons.codec.binary"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/commons/codec/binary/BaseNCodec.html" target="_top">Frames</a></li>
<li><a href="BaseNCodec.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2002-2013 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.</small></p>
</body>
</html>
